package com.bjgov.scoresys.entity;
// default package

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ProjectItems entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "project_items", catalog = "scoresys")
public class ProjectItems implements java.io.Serializable {

	// Fields

	private Integer id;
	private Project project;
	private ScoreItem scoreItem;
	private Float score;
	private Integer topCateId;
	private Integer controlId;

	// Constructors

	/** default constructor */
	public ProjectItems() {
	}

	/** minimal constructor */
	public ProjectItems(Project project, ScoreItem scoreItem) {
		this.project = project;
		this.scoreItem = scoreItem;
	}

	/** full constructor */
	public ProjectItems(Project project, ScoreItem scoreItem, Float score,
			Integer topCateId,Integer controlId) {
		this.project = project;
		this.scoreItem = scoreItem;
		this.score = score;
		this.topCateId = topCateId;
		this.controlId = controlId;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false)
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ITEM_ID", nullable = false)
	public ScoreItem getScoreItem() {
		return this.scoreItem;
	}

	public void setScoreItem(ScoreItem scoreItem) {
		this.scoreItem = scoreItem;
	}

	@Column(name = "[SCORE]", precision = 12, scale = 0)
	public Float getScore() {
		return this.score;
	}

	public void setScore(Float score) {
		this.score = score;
	}

	@Column(name = "TOP_CATE_ID")
	public Integer getTopCateId() {
		return this.topCateId;
	}

	public void setTopCateId(Integer topCateId) {
		this.topCateId = topCateId;
	}
	
	@Column(name = "ControlId_ID")
	public Integer getControlId() {
		return this.controlId;
	}

	public void setControlId(Integer controlId) {
		this.controlId = controlId;
	}

}